package com.yuanqi.dz.dc.util;

import pnbclient.CompService;
import pnbclient.alias.MultiDBTransactionService;
import pnbclient.alias.SQLCommandService;
import pnbclient.alias.StoredProcedureService;

public class PnbClientUtil{
	public static SQLCommandService  getSQLCommandService(){
		pnbclient.alias.SQLCommandService sql =  new pnbclient.alias.SQLCommandService(ReadProper.getProperties("HostAddress"),ReadProper.getProperties("ProtocolAdapter"));
		sql.setCharset(ReadProper.getProperties("CharSet"));
		sql.setDataformat(ReadProper.getProperties("Dataformat"));
		sql.setTransName(ReadProper.getProperties("DefaultTransName"));
		sql.setLangId(ReadProper.getProperties("DefaultLangId"));
		sql.setAppId(ReadProper.getProperties("AppId"));
		sql.setZipped(false);
		return sql;
	}


	public static StoredProcedureService  getStoredProcedureService(){
		pnbclient.alias.StoredProcedureService sp =  new pnbclient.alias.StoredProcedureService(ReadProper.getProperties("HostAddress"),ReadProper.getProperties("ProtocolAdapter"));
		sp.setCharset(ReadProper.getProperties("CharSet"));
		sp.setDataformat(ReadProper.getProperties("Dataformat"));
		sp.setTransName(ReadProper.getProperties("DefaultTransName"));
		sp.setLangId(ReadProper.getProperties("DefaultLangId"));
		sp.setAppId(ReadProper.getProperties("AppId"));
		sp.setZipped(false);
		return sp;
	}

	public static pnbclient.command.SQLCommandService  getSQLCommand(){
		pnbclient.command.SQLCommandService  sql =  new pnbclient.command.SQLCommandService (ReadProper.getProperties("HostAddress"),ReadProper.getProperties("ProtocolAdapter"));
		sql.setCharset(ReadProper.getProperties("CharSet"));
		sql.setDataformat(ReadProper.getProperties("Dataformat"));
		sql.setTransName(ReadProper.getProperties("DefaultTransName"));
		sql.setLangId(ReadProper.getProperties("DefaultLangId"));
		sql.setAppId(ReadProper.getProperties("AppId"));
		sql.setZipped(false);
		return sql;
	}


	public static MultiDBTransactionService  getMultiDBTransactionService(){
		MultiDBTransactionService  sql =  new MultiDBTransactionService(ReadProper.getProperties("HostAddress"),ReadProper.getProperties("ProtocolAdapter"));
		sql.setCharset(ReadProper.getProperties("CharSet"));
		sql.setDataformat(ReadProper.getProperties("Dataformat"));
		sql.setTransName(ReadProper.getProperties("DefaultTransName"));
		sql.setLangId(ReadProper.getProperties("DefaultLangId"));
		sql.setAppId(ReadProper.getProperties("AppId"));
		sql.setZipped(false);
		return sql;
	}


	public static  CompService getCompService(){
		CompService  sql =  new CompService();
		sql.setDataformat(ReadProper.getProperties("Dataformat"));
		sql.setAppId(ReadProper.getProperties("AppId"));
		return sql;

	}
}
